package com.sollink.sat.solver;

import java.util.HashMap;
import java.util.Vector;

public class WatcherList {

	public HashMap<Integer, Vector<Clause>> watcherlist;
	
	public WatcherList(int numOfVar) {
		watcherlist= new HashMap<Integer, Vector<Clause>>();
		for(int i=0; i<numOfVar; i++) {
			watcherlist.put((i+1), new Vector<Clause>());
			watcherlist.put(-(i+1), new Vector<Clause>());
		}
	}
	
	public Vector<Clause> getList(int literal) {
		Vector<Clause> list = watcherlist.get(literal);
		watcherlist.put(literal, new Vector<Clause>());
		return list;
	}
	
	public void push(int literal, Clause clause) {
		Vector<Clause> list = watcherlist.get(literal);
		list.add(clause);
	}
}
